#!/bin/sh
#
# release
#
# Copyright (C) 2016-2020 Wu Zhangjin <lzufalcon@163.com>
#

[ -z $RELEASE ] && RELEASE=0

uname | grep -q MINGW && PWD_OPT="-W"
TOP_DIR="$(cd "$(dirname "$0")"/../../ && pwd $PWD_OPT)"

[ -z "$CLOUD_LAB_TOP_DIR" ] && CLOUD_LAB_TOP_DIR="$(echo "$TOP_DIR" | sed -e "s%/output/.*%%g")"

[ "$TOP_DIR" != "$CLOUD_LAB_TOP_DIR" -a $RELEASE -eq 0 ] && echo "LOG: Please try following command:" \
	&& echo "RELEASE=1 $0" | sed -e "s%$CLOUD_LAB_TOP_DIR/%%g" && exit 0

. "$TOP_DIR/tools/docker/config" $* >/dev/null

filter=$1
[ -n "$2" ] && filter=$2

get_lab_info "$TOP_DIR/tools/docker/list" "$filter"
